﻿@using EFDataModel
@model ContactMvc4TB.Models.Worktime.CreateWorktimeEntryModel
@* Partial View für die Listenansicht *@

    <div class="span12">
        <div class="btn-group">
            @{
                string daily = "btn ", byEntry = "btn ";
                if (Model.WorktimeListType == EWorktimeListTypes.ByDay)
                {
                    daily += "active";
                }
                else
                {
                    byEntry += "active";
                }
                
                @Html.ActionLink("Tagesansicht", EActionWorktime.WorktimeDailyFilter.ToString(), EControllers.Worktime.ToString(), new { id = Model.UserId }, new { @class = daily })
                @Html.ActionLink("Letzten Einträge anzeigen", EActionWorktime.WorktimeLastEntryFilter.ToString(), EControllers.Worktime.ToString(), new { id = Model.UserId }, new { @class = byEntry })
            }
        </div>
    </div>
    <div class="span12">
        &nbsp;
    </div>
    <div class="span12">
        <div class="well well-small">
            <table class="table table-striped">
    <tbody>
        @foreach (ListEntry entryModel in Model.WorktimeList)
        {
            <tr>
                <td>
                        <b>@WorktimeHelper.GetWorktimeTypeString(entryModel.WorktimeType)</b>
                            @if (entryModel.WorktimeType == EWorktimeType.Projecttime && entryModel.HasProject)
                            {
                                @:[@entryModel.ProjectName]
                            }
                        <br/>
                       <b>@entryModel.CurrentDate.ToString(WebConstants.TableDateTimeFormatWithDay)</b>
                        @if (entryModel.WorktimeType != EWorktimeType.OfficalHoliday)
                        {
                            @:von<b>
                            @entryModel.StartTime.ToString(WebConstants.TimeFormat)
                            @:</b>bis<b>
                            @entryModel.EndTime.ToString(WebConstants.TimeFormat)
                            @:</b>Dauer:<b>
                            @Html.Worktimes().MinToHours(entryModel.Duration)
                            @:</b>
                        }
                        <br />

                        @if (entryModel.IsManualOverTime)
                        {
                            @:<b>Manueller Überstundenausgleich:</b>
                            @Html.Worktimes().MinToHours(entryModel.ManualOvertimeInMinutes)
                            @:<br />
                        }
                              
                        @if (entryModel.Description.Trim().Length > 0)
                        {
                            @:<b>Bezeichnung:</b>
                            @entryModel.Description
                            @:<br />
                        }
                        
                        @if (entryModel.Notice.Trim().Length > 0)
                        {
                            @:<b>Beschreibung:</b>
                            @entryModel.Notice
                            <br />
                        }
                </td>
                <td>
                        @Html.ActionLink(" ", EActionWorktime.Worktime.ToString(), EControllers.Worktime.ToString(), new { id = entryModel.WorktimeId, userId = entryModel.UserId }, new { data_icon = "icon-pencil" })
                        @Html.ActionLink(" ", EActionWorktime.DeleteWorktime.ToString(), EControllers.Worktime.ToString(), new { id = entryModel.WorktimeId, userId = entryModel.UserId }, new { data_icon = "icon-trash" })
                </td>
            </tr>
        }
    </tbody>
</table>
        </div>
    </div>



